package com.bh.common.enums;


import com.bh.common.constant.CacheConstants;

/**
 * 员工状态
 * 
 * @author ruo-yi
 */
public enum DatabaseType
{
    //所有设置必须以DB_开头
    /**
     * user
     */
    DB_SYSUSER(CacheConstants.DB_SYSUSER, "nick_name",""),
    /**
     * dept
     */
    DB_SYSDEPT(CacheConstants.DB_SYSDEPT, "dept_name",""),

    /**
     * dept
     */
    DB_ORG(CacheConstants.DB_ORG, "name","id"),

    /**
     *
     */
    DB_REGISTRATION(CacheConstants.DB_REGISTRATION, "name","id"),


    DB_VEHICLE_HEAD(CacheConstants.DB_VEHICLE_HEAD, "code","id"),


    /**
     * JC_SYS_ORGANIZATION
     */
    DB_JC_ORG( "( select * from JC_SYS_ORGANIZATION ) org", "org.name","org.id"),

    /**
     * JC_SYS_ORGANIZATION
     */
    //原来的意思是查询所属 org的费用类型，目前没有加 org_id的查询，默认应该加
    DB_TRANSPORT_ORDER_FEE_TYPE( "( select * from JC_FEE_TYPE where transportOrder = 1 and category = 0 ) fee", "fee.name","fee.code"),
    DB_TRANSPORT_SHIPMENT_FEE_TYPE( "( select * from JC_FEE_TYPE where shipmentModule = 1 and category = 1 ) fee", "fee.name","fee.code"),
    DB_TRANSPORT_DISPATCH_FEE_TYPE( "( select * from JC_FEE_TYPE where dispatch = 1 and category = 1 ) fee", "fee.name","fee.code"),
    // 代表混合在一起的所有类型
    DB_TRANSPORT_MIX_ORDER_FEE_TYPE( "( select * from JC_FEE_TYPE where transportOrder = 1 and category = 0 ) fee", "fee.name","fee.code"),
    // 代表混合在一起的所有类型
    DB_TRANSPORT_MIX_SHIPMENT_FEE_TYPE( "( select * from JC_FEE_TYPE where shipmentModule = 1 and category = 1 ) fee", "fee.name","fee.code"),

    DB_JC_VEHICLE( "( select * from JC_VEHICLE where status = 1 ) vehicle", "vehicle.code","vehicle.id"),
    ;

    DatabaseType(String tableName, String textFiled, String valueFiled) {
        this.tableName = tableName;
        this.textFiled = textFiled;
        this.valueFiled = valueFiled;
    }

    private final String tableName;
    private final String textFiled;
    private final String valueFiled;

    public String getTableName() {
        return tableName;
    }

    public String getTextFiled() {
        return textFiled;
    }

    public String getValueFiled() {
        return valueFiled;
    }
}
